package com.example.dazuoye.mapper;

import com.example.dazuoye.model.Car;
import com.example.dazuoye.model.Order;
import com.example.dazuoye.model.User;
import com.example.dazuoye.model.Wallet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.jmx.export.annotation.ManagedOperationParameter;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

@Mapper
@Component
public interface UserMapper {
    User getuserinfo(@Param("u_id") String Userid);
    Car getcarinfo(@Param("c_id") int Carid);
    Wallet getwalletinfo(@Param("u_id") String Userid);
    Date getvipinfo(@Param("u_id") String Userid);
    int getusingstate(@Param("c_id") int Carid);
    void updateusingstate(@Param("c_id") int Carid,@Param("isusing") int isusing);
    void newuseritem(@Param("u_id") String Userid,@Param("accepted") int accepted);
    void newvipitem(@Param("u_id") String Userid);
    void newwalletitem(@Param("u_id") String Userid,@Param("money") int money,@Param("deposit") int deposit,@Param("coupon_count") int cc);
    void setviptime(@Param("u_id") String Userid,@Param("endtime") Date et);
    void charge(@Param("u_id") String Userid,@Param("amount") int amount);
    void paydeposit(@Param("u_id") String Userid,@Param("amount") int amount);
    void costmoney(@Param("u_id") String Userid,@Param("cost") int cost);
    void updatecarsite(@Param("c_id") int Carid,@Param("carsite") String carsite);
    List<Car> getallcar();
    List<Car> getunusedcar();
    void licensepic(@Param("u_id")String u_id, @Param("licensepicurl")String licensepicurl);
    void uplicensepic(@Param("u_id") String u_id);
    void insertstarttime(@Param("u_id")String u_id,@Param("c_id")int c_id,@Param("start")Date start);
    void updatefinishtime(@Param("u_id")String u_id,@Param("c_id")int c_id,@Param("finish")Date finish,@Param("payoff") String payoff);
    Date searchstarttime(@Param("u_id")String u_id,@Param("c_id")int c_id);
    List<Order> getorder(@Param("u_id") String u_id);
    List<Order> getfinishorder(@Param("u_id") String u_id);
    List<Order> getunfinishorder(@Param("u_id") String u_id);
}
